//author:kakake
var Model = /** @class */ (function () {
    function Model() {
    }
    return Model;
}());

//author:kakake
var Common = /** @class */ (function () {
    function Common() {
    }
    return Common;
}());

//author:kakake
var tspayService = /** @class */ (function () {
    function tspayService(workid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1
        };
        this.MchModel = {
            model: {
                ID: 0,
                SubMchId: "",
                SubMchName: "",
                Purpose: "",
                Keys: "",
                WorkId: 1,
                DelFlag: 0,
                PassWord: ""
            },
            tablename: "Pay_Mch",
            key: "ID",
            val: "0",
            objval: {},
            where: "",
            pageinfo: {},
            WorkId: 1
        };
        this.PaymentModel = {
            model: {
                PaymentId: 0,
                AppID: "",
                AppSecret: "",
                ApiKey: "",
                MchId: "",
                SubMchId: "",
                NotifyUrl: "",
                BusinessNotifyUrl: "",
                RefundNotifyUrl: "",
                BusinessRefundNotifyUrl: "",
                ApiClientCert: "",
                PayType: 0,
                IsUse: 0,
                ImgUrl: "",
                Memo: ""
            },
            tablename: "Pay_PaymentType",
            key: "PaymentId",
            val: "0",
            objval: {},
            where: "",
            pageinfo: {},
            WorkId: 1
        };
        this.data.WorkId = workid;
        this.MchModel.WorkId = this.data.WorkId;
        this.PaymentModel.WorkId = this.data.WorkId;
    }
    tspayService.prototype.generateTimeReqestNumber = function () {
        var date = new Date();
        return date.getFullYear().toString() + this.pad2(date.getMonth() + 1) + this.pad2(date.getDate()) + this.pad2(date.getHours()) + this.pad2(date.getMinutes()) + this.pad2(date.getSeconds());
    };
    tspayService.prototype.pad2 = function (n) { return n < 10 ? '0' + n : n + ''; };
    return tspayService;
}());
/**
 * 商户号服务
 */
var mchService = /** @class */ (function () {
    function mchService(workid, appid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = workid;
        this.data.AppId = appid;
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
    }
    /**
     * 支付渠道设置
     */
    mchService.prototype.getmchlist = function (page, limit, searchkey) {
        var pageInfo = {
            key: "Id",
            page: page,
            perPage: limit,
            totalRecord: 100
        };
        var strsql = "select * from Pay_Mch where SubMchId like @searchkey or SubMchName like @searchkey";
        var dbparam = {
            searchkey: "%" + searchkey + "%"
        };
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparam, pageInfo);
        return { data: data, count: pageInfo.totalRecord };
    };
    /**
     * 保存支付渠道
     */
    mchService.prototype.savemch = function (mchobj) {
        if (parseInt(mchobj.ID) == 0) { //新增
            var subMchId = this.service.generateTimeReqestNumber() + Math.ceil(Math.random() * 1000000);
            mchobj.SubMchId = subMchId;
            mchobj.DelFlag = 0;
            mchobj.PassWord = TSLobsterAPI.Utils.DesEncrypt("123456");
            this.service.MchModel.objval = mchobj;
        }
        else { //修改
            this.service.MchModel.val = mchobj.ID;
            var _mchobj = TSLobsterAPI.DbHelper.GetModel(this.data.dbConn, this.service.MchModel);
            _mchobj.SubMchName = mchobj.SubMchName;
            _mchobj.Purpose = mchobj.Purpose;
            _mchobj.Keys = mchobj.Keys;
            this.service.MchModel.objval = _mchobj;
        }
        TSLobsterAPI.DbHelper.SaveModel(this.data.dbConn, this.service.MchModel);
        return { result: true };
    };
    /**
     * 设置商户号密码
     */
    mchService.prototype.setpwd = function (model) {
        var strsql = "select * from Pay_Mch where SubMchId=@SubMchId";
        var oldmch = TSLobsterAPI.DbHelper.DbGetJsonObject(this.data.dbConn, strsql, { SubMchId: model.SubMchId });
        if (oldmch) {
            if (TSLobsterAPI.Utils.DesEncrypt(model.oldpassword) != oldmch.PassWord) {
                throw "原始密码错误";
            }
            if (TSLobsterAPI.Utils.DesEncrypt(model.newpassword) == oldmch.PassWord) {
                throw "新密码不能和原始密码一样";
            }
            strsql = "update pay_Mch set PassWord =@password where SubMchId = @SubMchId";
            var dbparams = {
                SubMchId: model.SubMchId,
                password: TSLobsterAPI.Utils.DesEncrypt(model.newpassword)
            };
            TSLobsterAPI.DbHelper.DbExecuteUpdate(this.data.dbConn, strsql, dbparams);
        }
        else {
            throw '找不到数据';
        }
    };
    /**
     * 停用启用商户号
     */
    mchService.prototype.setdelflag = function (id, status) {
        var strsql = "UPDATE Pay_Mch SET DelFlag=@status WHERE ID=@id";
        TSLobsterAPI.DbHelper.DbExecuteUpdate(this.data.dbConn, strsql, { id: id, status: status });
        return { result: true };
    };
    /**
     * 获取支付方式配置
     */
    mchService.prototype.getpaymentlist = function (subMchId) {
        var strsql = "select * from  Pay_PaymentType where SubMchId=@subMchId";
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, { subMchId: subMchId });
        return { data: data };
    };
    /**
     * 保存支付方式配置
     */
    mchService.prototype.savepayment = function (model) {
        var _this = this;
        var list = JSON.parse(model.paymentlist);
        list.forEach(function (a) {
            _this.service.PaymentModel.objval = a;
            TSLobsterAPI.DbHelper.SaveModel(_this.data.dbConn, _this.service.PaymentModel);
        });
    };
    return mchService;
}());
/**
 * 支付记录服务
 */
var payService = /** @class */ (function () {
    function payService(workid, appid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = workid;
        this.data.AppId = appid;
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
    }
    /**
     * 获取支付交易记录
     */
    payService.prototype.getpaylist = function (page, limit, orderNo, paystate, orderType, sdate, edate) {
        var pageInfo = {
            key: "Id",
            page: page,
            perPage: limit,
            totalRecord: 100
        };
        var strsql = "SELECT * ,isnull( (select sum(RefundFee) from Pay_RefundOrder where OrderNo=a.OrderNo and RefundStatus=1),0.00) as RefundFee  from Pay_Order a WHERE a.WorkId=@workid ";
        var dbparams = {
            workid: this.data.WorkId,
            orderNo: '%' + orderNo + '%',
            paystate: paystate,
            orderType: orderType,
            sdate: sdate,
            edate: edate
        };
        if ((orderNo || "") != "") {
            strsql += " and a.OrderNo Like @orderNo or a.BusinessOrderNo Like @orderNo ";
        }
        if (parseInt(paystate) > -1) {
            strsql += " and a.PayState =  @paystate ";
        }
        if (parseInt(orderType) > -1) {
            strsql += " and a.orderType = @orderType ";
        }
        if ((sdate || "") != "") {
            strsql += " and a.OrderDate >= @sdate ";
        }
        if ((edate || "") != "") {
            strsql += " and a.OrderDate <= @edate ";
        }
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams, pageInfo);
        return { data: data, count: pageInfo.totalRecord };
    };
    /**
     * 后台退款
     */
    payService.prototype.refundforself = function (model) {
        try {
            this.data.dbConn.BeginTransaction();
            var strsql = "select * from Pay_Order where SubMchId=@SubMchId and OrderNo=@OrderNo";
            var dbparams = {
                SubMchId: model.SubMchId,
                OrderNo: model.OrderNo,
                PayType: model.PayType
            };
            var order = TSLobsterAPI.DbHelper.DbGetJsonObject(this.data.dbConn, strsql, dbparams);
            if (!order.ID) {
                throw '订单不存在';
            }
            strsql = "select * from Pay_Mch where SubMchId=@SubMchId";
            var mch = TSLobsterAPI.DbHelper.DbGetJsonObject(this.data.dbConn, strsql, dbparams);
            if (!mch.ID) {
                throw '配置错误';
            }
            if (TSLobsterAPI.Utils.DesEncrypt(model.PassWord) != mch.PassWord) {
                throw '密码错误';
            }
            strsql = "select * from Pay_PaymentType where SubMchId=@SubMchId and PayType=@PayType";
            var payment = TSLobsterAPI.DbHelper.DbGetJsonObject(this.data.dbConn, strsql, dbparams);
            if (!payment.PaymentId) {
                throw '配置错误';
            }
            strsql = "update Pay_Order set PayState=6 where ID=@ID";
            var ret = TSLobsterAPI.DbHelper.DbExecuteUpdate(this.data.dbConn, strsql, { ID: order.ID });
            strsql = "INSERT INTO Pay_RefundOrder (SubMchId ,OrderNo ,BusinessOrderNo ,TradeNo ,RefundDate ,RefundFee ,SettlementRefundFee\
                    ,RefundNo ,RefundStatus ,RefundDesc,WorkId)\
              VALUES  (@SubMchId,@OrderNo,@BusinessOrderNo,@TradeNo,getdate(),@RefundRealFee,@RefundRealFee,@RefundNo,@RefundStatus,@RefundDesc,@WorkId)";
            var refundNo = "R" + this.service.generateTimeReqestNumber();
            var dbparams2 = {
                SubMchId: model.SubMchId,
                OrderNo: order.OrderNo,
                BusinessOrderNo: order.BusinessOrderNo,
                TradeNo: order.TradeNo,
                RefundRealFee: model.RefundRealFee,
                RefundNo: refundNo,
                RefundStatus: order.PayType == 3 ? 1 : 0,
                RefundDesc: model.RefundDesc,
                WorkId: this.data.WorkId
            };
            ret = TSLobsterAPI.DbHelper.DbExecuteUpdate(this.data.dbConn, strsql, dbparams2);
            var refundobject = {
                AppID: payment.AppID,
                MchId: payment.MchId,
                ApiKey: payment.ApiKey,
                RefundNotifyUrl: payment.RefundNotifyUrl,
                SubMchId: payment.SubMchId,
                OrderNo: order.OrderNo,
                RefundNo: refundNo,
                PayFee: order.TotalFee * 100,
                RefundRealFee: model.RefundRealFee * 100,
                RefundDesc: model.RefundDesc
            };
            //调用微信接口
            var res = TSLobsterAPI.Http.Post('/pay/v1/pay/Refund', refundobject);
            if (res['code'] != 0) {
                throw res['msg'];
            }
            this.data.dbConn.CommitTransaction();
            return { result: true };
        }
        catch (e) {
            this.data.dbConn.RollbackTransaction();
            throw e;
        }
    };
    /**
     * 获取退款详情
     */
    payService.prototype.getrefundlistdetail = function (orderNo) {
        var strsql = "SELECT * from Pay_RefundOrder WHERE WorkId=@WorkId and RefundStatus=1 and OrderNo like @orderNo ";
        var dbparams = {
            WorkId: this.data.WorkId,
            orderNo: '%' + orderNo + '%'
        };
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams);
        return { data: data };
    };
    return payService;
}());
/**
 * 退费服务
 */
var refundService = /** @class */ (function () {
    function refundService(workid, appid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = workid;
        this.data.AppId = appid;
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
    }
    /**
     * 获取退款记录
     */
    refundService.prototype.getrefundlist = function (page, limit, orderNo, refundStatus, sdate, edate) {
        var pageInfo = {
            key: "Id Desc",
            page: page,
            perPage: limit,
            totalRecord: 100
        };
        var strsql = "SELECT * from Pay_RefundOrder a WHERE a.WorkId=@workid ";
        var dbparams = {
            workid: this.data.WorkId,
            orderNo: '%' + orderNo + '%',
            refundStatus: refundStatus,
            sdate: sdate + " 00:00:01",
            edate: edate + " 23:59:59"
        };
        if ((orderNo || "") != "") {
            strsql += " and a.RefundNo Like @orderNo or a.OrderNo Like @orderNo";
        }
        if (refundStatus > -1) {
            strsql += " and a.RefundStatus =  @refundStatus";
        }
        if ((sdate || "") != "") {
            strsql += " and a.RefundDate >=  @sdate";
        }
        if ((edate || "") != "") {
            strsql += " and a.RefundDate <=  @edate";
        }
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams, pageInfo);
        return { data: data, count: pageInfo.totalRecord };
    };
    return refundService;
}());
/**
 * 账单服务
 */
var billService = /** @class */ (function () {
    function billService(workid, appid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = workid;
        this.data.AppId = appid;
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
    }
    billService.prototype.gettransactionlist = function (page, limit, type, sdate, edate) {
        var pageInfo = {
            key: "TransactionDate",
            page: page,
            perPage: limit,
            totalRecord: 100
        };
        var strsql = '';
        if (type == 1) {
            strsql = "select * from (select OrderDate as TransactionDate,SubMchId,OrderNo,BusinessOrderNo,TradeNo,'' as RefundNo,'' as BusinessRefundNo,'' as RefundTradeNo, TotalFee as PayFee, 0 as RefundFee, WorkId from Pay_Order where PayState in(2,3,4)\
                        union all \
                        select RefundDate as TransactionDate,SubMchId,OrderNo,BusinessOrderNo,'' as TradeNo, RefundNo,BusinessRefundNo,TradeNo as RefundTradeNo, 0 as PayFee,RefundFee,WorkId from Pay_RefundOrder where RefundStatus =1\
                        ) a where a.WorkId=@workid";
        }
        else if (type == 2) {
            strsql = "select * from (select OrderDate as TransactionDate,SubMchId,OrderNo,BusinessOrderNo,TradeNo,'' as RefundNo,'' as BusinessRefundNo,'' as RefundTradeNo, TotalFee as PayFee, 0 as RefundFee, WorkId from Pay_Order where PayState in(2,3,4)\
            ) a where a.WorkId=@workid";
        }
        else if (type == 3) {
            strsql = "select * from (select RefundDate as TransactionDate,SubMchId,OrderNo,BusinessOrderNo,'' as TradeNo, RefundNo,BusinessRefundNo,TradeNo as RefundTradeNo, 0 as PayFee,RefundFee,WorkId from Pay_RefundOrder where RefundStatus =1\
            ) a where a.WorkId=@workid";
        }
        var dbparams = {
            workid: this.data.WorkId,
            sdate: sdate + " 00:00:01",
            edate: edate + " 23:59:59"
        };
        if ((sdate || "") != "") {
            strsql += " and a.TransactionDate >=  @sdate";
        }
        if ((edate || "") != "") {
            strsql += " and a.TransactionDate <=  @edate";
        }
        var data = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams, pageInfo);
        return { data: data, count: pageInfo.totalRecord };
    };
    billService.prototype.getreport = function (sdate, edate, type) {
        return { result: true };
    };
    return billService;
}());
/**
 * 实时数据服务
 */
var realtimeService = /** @class */ (function () {
    function realtimeService(workid, appid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = workid;
        this.data.AppId = appid;
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
    }
    realtimeService.prototype.getchartdata = function (type) {
        if (type == 0) {
            var strsql = "select a.OrderDate,sum(a.TotalFee) as TotalFee,count(0) as num from (select CONVERT(varchar(13),OrderDate,120) as OrderDate,TotalFee from Pay_Order where PayState>1 \
        and OrderDate <=CONVERT(varchar(13), dateadd(HOUR,-1, GETDATE()) ,120)+':00:00'\
        and OrderDate>=CONVERT(varchar(13), dateadd(HOUR,-24, GETDATE()) ,120)+':00:00' and WorkId=@workid) as  a\
        group by a.OrderDate\
        order by a.OrderDate";
            var ydata1 = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, { workid: this.data.WorkId });
            strsql = "select a.OrderDate,sum(a.TotalFee) as TotalFee,count(0) as num from (select CONVERT(varchar(13),OrderDate,120) as OrderDate,TotalFee from Pay_Order where PayState>1  \
        and OrderDate <=CONVERT(varchar(13), dateadd(HOUR,-25, GETDATE()) ,120)+':00:00'\
        and OrderDate>=CONVERT(varchar(13), dateadd(HOUR,-48, GETDATE()) ,120)+':00:00' and WorkId=@workid) as  a\
        group by a.OrderDate\
        order by a.OrderDate";
            var ydata2 = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, { workid: this.data.WorkId });
            return {
                ydata1: ydata1,
                ydata2: ydata2
            };
        }
        else if (type == 1) {
            var self = this;
            var strsql = "select a.OrderDate,count(0) as TotalFee from (select CONVERT(varchar(13),OrderDate,120) as OrderDate,TotalFee from Pay_Order where PayState=2 \
        and OrderDate <=CONVERT(varchar(13), dateadd(HOUR,-1, GETDATE()) ,120)+':00:00'\
        and OrderDate>=CONVERT(varchar(13), dateadd(HOUR,-24, GETDATE()) ,120)+':00:00' and WorkId=@workid) as  a\
        group by a.OrderDate\
        order by a.OrderDate";
            var ydata1 = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, { workid: this.data.WorkId });
            strsql = "select a.OrderDate,count(0) as TotalFee from (select CONVERT(varchar(13),OrderDate,120) as OrderDate,TotalFee from Pay_Order where PayState=2 \
        and OrderDate <=CONVERT(varchar(13), dateadd(HOUR,-25, GETDATE()) ,120)+':00:00'\
        and OrderDate>=CONVERT(varchar(13), dateadd(HOUR,-48, GETDATE()) ,120)+':00:00' and WorkId=@workid) as  a\
        group by a.OrderDate\
        order by a.OrderDate";
            var ydata2 = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, { workid: this.data.WorkId });
            return {
                ydata1: ydata1,
                ydata2: ydata2
            };
        }
    };
    return realtimeService;
}());

//author:kakake
var tspayController = /** @class */ (function () {
    function tspayController() {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1,
            AppId: 1
        };
        this.data.WorkId = TSLobsterAPI.Program.GetWorkId();
        this.data.AppId = TSLobsterAPI.Program.GetAppId();
        this.service = new tspayService(this.data.WorkId);
        this.dao = new tspayDao(this.data.WorkId);
        this.mchservice = new mchService(this.data.WorkId, this.data.AppId);
        this.payservice = new payService(this.data.WorkId, this.data.AppId);
        this.refundservice = new refundService(this.data.WorkId, this.data.AppId);
        this.billservice = new billService(this.data.WorkId, this.data.AppId);
        this.realtimeservice = new realtimeService(this.data.WorkId, this.data.AppId);
    }
    /**
     * 获取支付方式
     */
    tspayController.prototype.getdic_paytype = function () {
        var data = TSLobsterAPI.AppFunction.GetAppBaseDict(this.data.AppId, '8331');
        return { data: data };
    };
    /**
     * 获取订单类型
     */
    tspayController.prototype.getdic_ordertype = function () {
        var data = TSLobsterAPI.AppFunction.GetAppBaseDict(this.data.AppId, '8329');
        return { data: data };
    };
    /**
     * 支付渠道设置
     */
    tspayController.prototype.getmchlist = function () {
        var page = TSLobsterAPI.Program.RequestQuery("page", "1");
        var perPage = TSLobsterAPI.Program.RequestQuery("limit", "10");
        var searchkey = TSLobsterAPI.Program.RequestQuery("searchkey") || "";
        return this.mchservice.getmchlist(page, perPage, searchkey);
    };
    /**
     * 保存支付渠道
     */
    tspayController.prototype.savemch = function () {
        var mchobj = JSON.parse(TSLobsterAPI.Program.RequestBody());
        this.mchservice.savemch(mchobj);
        return { result: true };
    };
    /**
     * 设置商户号密码
     */
    tspayController.prototype.setpwd = function () {
        var model = JSON.parse(TSLobsterAPI.Program.RequestBody());
        this.mchservice.setpwd(model);
        return { result: true };
    };
    /**
     * 停用启用商户号
     */
    tspayController.prototype.setdelflag = function () {
        var id = TSLobsterAPI.Program.RequestQuery('id');
        var status = TSLobsterAPI.Program.RequestQuery('status');
        this.mchservice.setdelflag(id, status);
        return { result: true };
    };
    /**
     * 获取支付方式配置
     */
    tspayController.prototype.getpaymentlist = function () {
        var subMchId = TSLobsterAPI.Program.RequestQuery('subMchId');
        return this.mchservice.getpaymentlist(subMchId);
    };
    /**
     * 保存支付方式配置
     */
    tspayController.prototype.savepayment = function () {
        var model = JSON.parse(TSLobsterAPI.Program.RequestBody());
        this.mchservice.savepayment(model);
        return { result: true };
    };
    /**
     * 获取支付交易记录
     */
    tspayController.prototype.getpaylist = function () {
        var page = TSLobsterAPI.Program.RequestQuery("page", "1");
        var perPage = TSLobsterAPI.Program.RequestQuery("limit", "10");
        var orderNo = TSLobsterAPI.Program.RequestQuery("orderNo", '');
        var paystate = TSLobsterAPI.Program.RequestQuery("paystate", '');
        var orderType = TSLobsterAPI.Program.RequestQuery("orderType", '');
        var sdate = TSLobsterAPI.Program.RequestQuery("sdate", '');
        var edate = TSLobsterAPI.Program.RequestQuery("edate", '');
        return this.payservice.getpaylist(page, perPage, orderNo, paystate, orderType, sdate, edate);
    };
    /**
     * 后台退款
     */
    tspayController.prototype.refundforself = function () {
        var model = JSON.parse(TSLobsterAPI.Program.RequestBody());
        return this.payservice.refundforself(model);
    };
    tspayController.prototype.getrefundlistdetail = function () {
        var orderNo = TSLobsterAPI.Program.RequestQuery("orderNo", '');
        return this.payservice.getrefundlistdetail(orderNo);
    };
    /**
     * 获取退款记录
     */
    tspayController.prototype.getrefundlist = function () {
        var page = TSLobsterAPI.Program.RequestQuery("page", 0);
        var limit = TSLobsterAPI.Program.RequestQuery("limit", 0);
        var orderNo = TSLobsterAPI.Program.RequestQuery("orderNo", '');
        var refundStatus = TSLobsterAPI.Program.RequestQuery("refundStatus", '');
        var sdate = TSLobsterAPI.Program.RequestQuery("sdate", '');
        var edate = TSLobsterAPI.Program.RequestQuery("edate", '');
        return this.refundservice.getrefundlist(page, limit, orderNo, refundStatus, sdate, edate);
    };
    tspayController.prototype.gettransactionlist = function () {
        var page = TSLobsterAPI.Program.RequestQuery("page", 0);
        var limit = TSLobsterAPI.Program.RequestQuery("limit", 0);
        var type = TSLobsterAPI.Program.RequestQuery("type", '');
        var sdate = TSLobsterAPI.Program.RequestQuery("sdate", '');
        var edate = TSLobsterAPI.Program.RequestQuery("edate", '');
        return this.billservice.gettransactionlist(page, limit, type, sdate, edate);
    };
    tspayController.prototype.getbillreport = function () {
        var sdate = TSLobsterAPI.Program.RequestQuery("sdate", '');
        var edate = TSLobsterAPI.Program.RequestQuery("edate", '');
        var type = TSLobsterAPI.Program.RequestQuery("type", '');
        return this.billservice.getreport(sdate, edate, type);
    };
    tspayController.prototype.getchartdata = function () {
        var type = TSLobsterAPI.Program.RequestQuery("type", 0);
        return this.realtimeservice.getchartdata(type);
    };
    return tspayController;
}());

//author:kakake
var tspayDao = /** @class */ (function () {
    function tspayDao(workid) {
        this.data = {
            dbConn: TSLobsterAPI.Program.GetDbConn(),
            WorkId: 1
        };
        this.data.WorkId = workid;
    }
    return tspayDao;
}());

